﻿using JuCheap.Core.Infrastructure;
using JuCheap.Core.Model;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace JuCheap.Core.IService.AppService
{
    /// <summary>
    /// 角色扩展服务
    /// </summary>
    public interface IRoleService
    {
        /// <summary>
        /// 创建角色
        /// </summary>
        /// <param name="roleReq">角色请求信息</param>
        /// <returns></returns>
        Task<string> CreateAsync(RoleCreateRequestDto roleReq);

        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="roleReq">角色请求信息</param>
        /// <returns>用户Id</returns>
        Task<string> UpdateAsync(RoleEditRequestDto roleReq);

        /// <summary>
        /// 角色菜单设置
        /// </summary>
        /// <param name="roleMenuSetReq"></param>
        /// <returns></returns>
        Task SetMenusAsync(RoleMenuSetRequestDto roleMenuSetReq);

        /// <summary>
        /// 获取角色拥有的菜单Id集合
        /// </summary>
        /// <param name="roleId">角色Id</param>
        /// <returns></returns>
        Task<IEnumerable<string>> GetRoleMenuIdsAysnc(string roleId);

        /// <summary>
        /// 角色分页扩展方法
        /// </summary>
        /// <param name="filter">基础分页参数</param>
        /// <returns></returns>
        Task<PagedResult<SysRoleDto>> QueryPagesAsync(SysRoleFilter filter);
    }
}
